<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
UnivariateSolverUtils (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="UnivariateSolverUtils (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/UnivariateSolverUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="UnivariateSolverUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.analysis.solvers</FONT>
<BR>
Class UnivariateSolverUtils</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.analysis.solvers.UnivariateSolverUtils</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>UnivariateSolverUtils</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Utility routines for <A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers"><CODE>UnivariateSolver</CODE></A> objects.
<P>

<P>
<DL>
<DT><B>Version:</B></DT>
  <DD>$Id: UnivariateSolverUtils.java 1400850 2012-10-22 11:57:17Z erans $</DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double)">bracket</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
        double&nbsp;initial,
        double&nbsp;lowerBound,
        double&nbsp;upperBound)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method attempts to find two values a and b satisfying 
  <code> lowerBound <= a < initial < b <= upperBound</code> 
  <code> f(a) * f(b) < 0 </code>
 
 If f is continuous on <code>[a,b],</code> this means that <code>a</code>
 and <code>b</code> bracket a root of f.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double, int)">bracket</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
        double&nbsp;initial,
        double&nbsp;lowerBound,
        double&nbsp;upperBound,
        int&nbsp;maximumIterations)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method attempts to find two values a and b satisfying 
  <code> lowerBound <= a < initial < b <= upperBound</code> 
  <code> f(a) * f(b) <= 0 </code> 
 
 If f is continuous on <code>[a,b],</code> this means that <code>a</code>
 and <code>b</code> bracket a root of f.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#forceSide(int, org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.analysis.solvers.BracketedUnivariateSolver, double, double, double, org.apache.commons.math3.analysis.solvers.AllowedSolution)">forceSide</A></B>(int&nbsp;maxEval,
          <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;f,
          <A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/BracketedUnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers">BracketedUnivariateSolver</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&gt;&nbsp;bracketing,
          double&nbsp;baseRoot,
          double&nbsp;min,
          double&nbsp;max,
          <A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/AllowedSolution.html" title="enum in org.apache.commons.math3.analysis.solvers">AllowedSolution</A>&nbsp;allowedSolution)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Force a root found by a non-bracketing solver to lie on a specified side,
 as if the solver was a bracketing one.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#isBracketing(org.apache.commons.math3.analysis.UnivariateFunction, double, double)">isBracketing</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
             double&nbsp;lower,
             double&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check whether the interval bounds bracket a root.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#isSequence(double, double, double)">isSequence</A></B>(double&nbsp;start,
           double&nbsp;mid,
           double&nbsp;end)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check whether the arguments form a (strictly) increasing sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#midpoint(double, double)">midpoint</A></B>(double&nbsp;a,
         double&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compute the midpoint of two values.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#solve(org.apache.commons.math3.analysis.UnivariateFunction, double, double)">solve</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
      double&nbsp;x0,
      double&nbsp;x1)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method to find a zero of a univariate real function.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#solve(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double)">solve</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
      double&nbsp;x0,
      double&nbsp;x1,
      double&nbsp;absoluteAccuracy)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method to find a zero of a univariate real function.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#verifyBracketing(org.apache.commons.math3.analysis.UnivariateFunction, double, double)">verifyBracketing</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                 double&nbsp;lower,
                 double&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that the endpoints specify an interval and the end points
 bracket a root.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#verifyInterval(double, double)">verifyInterval</A></B>(double&nbsp;lower,
               double&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that the endpoints specify an interval.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#verifySequence(double, double, double)">verifySequence</A></B>(double&nbsp;lower,
               double&nbsp;initial,
               double&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that <code>lower &lt; initial &lt; upper</code>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="solve(org.apache.commons.math3.analysis.UnivariateFunction, double, double)"><!-- --></A><H3>
solve</H3>
<PRE>
public static double <B>solve</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                           double&nbsp;x0,
                           double&nbsp;x1)
                    throws <A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                           <A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></PRE>
<DL>
<DD>Convenience method to find a zero of a univariate real function.  A default
 solver is used.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - Function.<DD><CODE>x0</CODE> - Lower bound for the interval.<DD><CODE>x1</CODE> - Upper bound for the interval.
<DT><B>Returns:</B><DD>a value where the function is zero.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></CODE> - if the function has the same sign at the
 endpoints.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>function</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="solve(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double)"><!-- --></A><H3>
solve</H3>
<PRE>
public static double <B>solve</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                           double&nbsp;x0,
                           double&nbsp;x1,
                           double&nbsp;absoluteAccuracy)
                    throws <A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                           <A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></PRE>
<DL>
<DD>Convenience method to find a zero of a univariate real function.  A default
 solver is used.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - Function.<DD><CODE>x0</CODE> - Lower bound for the interval.<DD><CODE>x1</CODE> - Upper bound for the interval.<DD><CODE>absoluteAccuracy</CODE> - Accuracy to be used by the solver.
<DT><B>Returns:</B><DD>a value where the function is zero.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></CODE> - if the function has the same sign at the
 endpoints.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>function</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="forceSide(int, org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.analysis.solvers.BracketedUnivariateSolver, double, double, double, org.apache.commons.math3.analysis.solvers.AllowedSolution)"><!-- --></A><H3>
forceSide</H3>
<PRE>
public static double <B>forceSide</B>(int&nbsp;maxEval,
                               <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;f,
                               <A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/BracketedUnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers">BracketedUnivariateSolver</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&gt;&nbsp;bracketing,
                               double&nbsp;baseRoot,
                               double&nbsp;min,
                               double&nbsp;max,
                               <A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/AllowedSolution.html" title="enum in org.apache.commons.math3.analysis.solvers">AllowedSolution</A>&nbsp;allowedSolution)
                        throws <A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></PRE>
<DL>
<DD>Force a root found by a non-bracketing solver to lie on a specified side,
 as if the solver was a bracketing one.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>maxEval</CODE> - maximal number of new evaluations of the function
 (evaluations already done for finding the root should have already been subtracted
 from this number)<DD><CODE>f</CODE> - function to solve<DD><CODE>bracketing</CODE> - bracketing solver to use for shifting the root<DD><CODE>baseRoot</CODE> - original root found by a previous non-bracketing solver<DD><CODE>min</CODE> - minimal bound of the search interval<DD><CODE>max</CODE> - maximal bound of the search interval<DD><CODE>allowedSolution</CODE> - the kind of solutions that the root-finding algorithm may
 accept as solutions.
<DT><B>Returns:</B><DD>a root approximation, on the specified side of the exact root
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></CODE> - if the function has the same sign at the
 endpoints.</DL>
</DD>
</DL>
<HR>

<A NAME="bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double)"><!-- --></A><H3>
bracket</H3>
<PRE>
public static double[] <B>bracket</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                               double&nbsp;initial,
                               double&nbsp;lowerBound,
                               double&nbsp;upperBound)
                        throws <A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                               <A HREF="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A>,
                               <A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></PRE>
<DL>
<DD>This method attempts to find two values a and b satisfying <ul>
 <li> <code> lowerBound <= a < initial < b <= upperBound</code> </li>
 <li> <code> f(a) * f(b) < 0 </code></li>
 </ul>
 If f is continuous on <code>[a,b],</code> this means that <code>a</code>
 and <code>b</code> bracket a root of f.
 <p>
 The algorithm starts by setting
 <code>a := initial -1; b := initial +1,</code> examines the value of the
 function at <code>a</code> and <code>b</code> and keeps moving
 the endpoints out by one unit each time through a loop that terminates
 when one of the following happens: <ul>
 <li> <code> f(a) * f(b) < 0 </code> --  success!</li>
 <li> <code> a = lower </code> and <code> b = upper</code>
 -- NoBracketingException </li>
 <li> <code> Integer.MAX_VALUE</code> iterations elapse
 -- NoBracketingException </li>
 </ul></p>
 <p>
 <strong>Note: </strong> this method can take
 <code>Integer.MAX_VALUE</code> iterations to throw a
 <code>ConvergenceException.</code>  Unless you are confident that there
 is a root between <code>lowerBound</code> and <code>upperBound</code>
 near <code>initial,</code> it is better to use
 <A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double, int)"><CODE>bracket(UnivariateFunction, double, double, double, int)</CODE></A>,
 explicitly specifying the maximum number of iterations.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - Function.<DD><CODE>initial</CODE> - Initial midpoint of interval being expanded to
 bracket a root.<DD><CODE>lowerBound</CODE> - Lower bound (a is never lower than this value)<DD><CODE>upperBound</CODE> - Upper bound (b never is greater than this
 value).
<DT><B>Returns:</B><DD>a two-element array holding a and b.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></CODE> - if a root cannot be bracketted.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>maximumIterations &lt;= 0</code>.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>function</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double, int)"><!-- --></A><H3>
bracket</H3>
<PRE>
public static double[] <B>bracket</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                               double&nbsp;initial,
                               double&nbsp;lowerBound,
                               double&nbsp;upperBound,
                               int&nbsp;maximumIterations)
                        throws <A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                               <A HREF="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A>,
                               <A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></PRE>
<DL>
<DD>This method attempts to find two values a and b satisfying <ul>
 <li> <code> lowerBound <= a < initial < b <= upperBound</code> </li>
 <li> <code> f(a) * f(b) <= 0 </code> </li>
 </ul>
 If f is continuous on <code>[a,b],</code> this means that <code>a</code>
 and <code>b</code> bracket a root of f.
 <p>
 The algorithm starts by setting
 <code>a := initial -1; b := initial +1,</code> examines the value of the
 function at <code>a</code> and <code>b</code> and keeps moving
 the endpoints out by one unit each time through a loop that terminates
 when one of the following happens: <ul>
 <li> <code> f(a) * f(b) <= 0 </code> --  success!</li>
 <li> <code> a = lower </code> and <code> b = upper</code>
 -- NoBracketingException </li>
 <li> <code> maximumIterations</code> iterations elapse
 -- NoBracketingException </li></ul></p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - Function.<DD><CODE>initial</CODE> - Initial midpoint of interval being expanded to
 bracket a root.<DD><CODE>lowerBound</CODE> - Lower bound (a is never lower than this value).<DD><CODE>upperBound</CODE> - Upper bound (b never is greater than this
 value).<DD><CODE>maximumIterations</CODE> - Maximum number of iterations to perform
<DT><B>Returns:</B><DD>a two element array holding a and b.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></CODE> - if the algorithm fails to find a and b
 satisfying the desired conditions.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>maximumIterations &lt;= 0</code>.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>function</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="midpoint(double, double)"><!-- --></A><H3>
midpoint</H3>
<PRE>
public static double <B>midpoint</B>(double&nbsp;a,
                              double&nbsp;b)</PRE>
<DL>
<DD>Compute the midpoint of two values.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - first value.<DD><CODE>b</CODE> - second value.
<DT><B>Returns:</B><DD>the midpoint.</DL>
</DD>
</DL>
<HR>

<A NAME="isBracketing(org.apache.commons.math3.analysis.UnivariateFunction, double, double)"><!-- --></A><H3>
isBracketing</H3>
<PRE>
public static boolean <B>isBracketing</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                                   double&nbsp;lower,
                                   double&nbsp;upper)
                            throws <A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></PRE>
<DL>
<DD>Check whether the interval bounds bracket a root. That is, if the
 values at the endpoints are not equal to zero, then the function takes
 opposite signs at the endpoints.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - Function.<DD><CODE>lower</CODE> - Lower endpoint.<DD><CODE>upper</CODE> - Upper endpoint.
<DT><B>Returns:</B><DD><code>true</code> if the function values have opposite signs at the
 given points.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>function</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="isSequence(double, double, double)"><!-- --></A><H3>
isSequence</H3>
<PRE>
public static boolean <B>isSequence</B>(double&nbsp;start,
                                 double&nbsp;mid,
                                 double&nbsp;end)</PRE>
<DL>
<DD>Check whether the arguments form a (strictly) increasing sequence.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>start</CODE> - First number.<DD><CODE>mid</CODE> - Second number.<DD><CODE>end</CODE> - Third number.
<DT><B>Returns:</B><DD><code>true</code> if the arguments form an increasing sequence.</DL>
</DD>
</DL>
<HR>

<A NAME="verifyInterval(double, double)"><!-- --></A><H3>
verifyInterval</H3>
<PRE>
public static void <B>verifyInterval</B>(double&nbsp;lower,
                                  double&nbsp;upper)
                           throws <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Check that the endpoints specify an interval.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - Lower endpoint.<DD><CODE>upper</CODE> - Upper endpoint.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="verifySequence(double, double, double)"><!-- --></A><H3>
verifySequence</H3>
<PRE>
public static void <B>verifySequence</B>(double&nbsp;lower,
                                  double&nbsp;initial,
                                  double&nbsp;upper)
                           throws <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Check that <code>lower &lt; initial &lt; upper</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - Lower endpoint.<DD><CODE>initial</CODE> - Initial value.<DD><CODE>upper</CODE> - Upper endpoint.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= initial</code> or
 <code>initial &gt;= upper</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="verifyBracketing(org.apache.commons.math3.analysis.UnivariateFunction, double, double)"><!-- --></A><H3>
verifyBracketing</H3>
<PRE>
public static void <B>verifyBracketing</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function,
                                    double&nbsp;lower,
                                    double&nbsp;upper)
                             throws <A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                                    <A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></PRE>
<DL>
<DD>Check that the endpoints specify an interval and the end points
 bracket a root.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - Function.<DD><CODE>lower</CODE> - Lower endpoint.<DD><CODE>upper</CODE> - Upper endpoint.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</A></CODE> - if the function has the same sign at the
 endpoints.
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>function</code> is <code>null</code>.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/UnivariateSolverUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="UnivariateSolverUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
